<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/doc/src/q3ptrlist.qdoc -->
<head>
  <title>Qt 4.3: Q3StrList Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Q3StrList Class Reference<br /><sup><sup>[<a href="qt3support.html">Qt3Support</a> module]</sup></sup></h1>
<p>The Q3StrList class provides a doubly-linked list of char*. <a href="#details">More...</a></p>
<pre> #include &lt;Q3StrList&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html">Porting to Qt 4</a> for more information.</p>
<p>Inherits <a href="q3ptrlist.html">Q3PtrList&lt;char&gt;</a>.</p>
<p>Inherited by <a href="q3strilist.html">Q3StrIList</a>.</p>
<ul>
<li><a href="q3strlist-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="q3strlist.html#Q3StrList">Q3StrList</a></b> ( bool <i>deepCopies</i> = true )</li>
<li><div class="fn"/><b><a href="q3strlist.html#Q3StrList-2">Q3StrList</a></b> ( const Q3StrList &amp; <i>list</i> )</li>
<li><div class="fn"/><b><a href="q3strlist.html#Q3StrList-3">Q3StrList</a></b> ( const QList&lt;QByteArray&gt; &amp; <i>list</i> )</li>
<li><div class="fn"/><b><a href="q3strlist.html#dtor.Q3StrList">~Q3StrList</a></b> ()</li>
<li><div class="fn"/><b><a href="q3strlist.html#operator-QList-ltQByteArray-gt">operator QList&lt;QByteArray&gt;</a></b> () const</li>
<li><div class="fn"/>Q3StrList &amp; <b><a href="q3strlist.html#operator-eq">operator=</a></b> ( const Q3StrList &amp; <i>list</i> )</li>
<li><div class="fn"/>Q3StrList &amp; <b><a href="q3strlist.html#operator-eq-2">operator=</a></b> ( const QList&lt;QByteArray&gt; &amp; <i>list</i> )</li>
</ul>
<ul>
<li><div class="fn"/>39 public functions inherited from <a href="q3ptrlist.html#public-functions">Q3PtrList</a></li>
<li><div class="fn"/>4 public functions inherited from <a href="q3ptrcollection.html#public-functions">Q3PtrCollection</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>3 protected functions inherited from <a href="q3ptrlist.html#protected-functions">Q3PtrList</a></li>
<li><div class="fn"/>2 protected functions inherited from <a href="q3ptrcollection.html#protected-functions">Q3PtrCollection</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The Q3StrList class provides a doubly-linked list of char*.</p>
<p>If you want a string list of <a href="qstring.html">QString</a>s use <a href="qstringlist.html">QStringList</a>.</p>
<p>This class is a <a href="q3ptrlist.html">Q3PtrList</a>&lt;char&gt; instance (a list of char*).</p>
<p>Q3StrList can make deep or shallow copies of the strings that are inserted.</p>
<p>A deep copy means that memory is allocated for the string and then the string data is copied into that memory. A shallow copy is just a copy of the pointer value and not of the string data itself.</p>
<p>The disadvantage of shallow copies is that because a pointer can be deleted only once, the program must put all strings in a central place and know when it is safe to delete them (i.e&#x2e; when the strings are no longer referenced by other parts of the program). This can make the program more complex. The advantage of shallow copies is that they consume far less memory than deep copies. It is also much faster to copy a pointer (typically 4 or 8 bytes) than to copy string data.</p>
<p>A Q3StrList that operates on deep copies will, by default, turn on auto-deletion (see <a href="q3ptrcollection.html#setAutoDelete">setAutoDelete</a>()). Thus, by default Q3StrList will deallocate any string copies it allocates.</p>
<p>The virtual <a href="q3ptrlist.html#compareItems">compareItems</a>() function is reimplemented and does a case-sensitive string comparison. The <a href="q3ptrlist.html#inSort">inSort</a>() function will insert strings in sorted order. In general it is fastest to insert the strings as they come and <a href="q3ptrlist.html#sort">sort</a>() at the end; <a href="q3ptrlist.html#inSort">inSort</a>() is useful when you just have to add a few extra strings to an already sorted list.</p>
<p>The <a href="q3strlistiterator.html">Q3StrListIterator</a> class is an iterator for Q3StrList.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="Q3StrList"></a>Q3StrList::Q3StrList ( bool <i>deepCopies</i> = true )</h3>
<p>Constructs an empty list of strings. Will make deep copies of all inserted strings if <i>deepCopies</i> is TRUE, or use shallow copies if <i>deepCopies</i> is FALSE.</p>
<h3 class="fn"><a name="Q3StrList-2"></a>Q3StrList::Q3StrList ( const Q3StrList &amp; <i>list</i> )</h3>
<p>Constructs a copy of <i>list</i>.</p>
<h3 class="fn"><a name="Q3StrList-3"></a>Q3StrList::Q3StrList ( const <a href="qlist.html">QList</a>&lt;<a href="qbytearray.html">QByteArray</a>&gt; &amp; <i>list</i> )</h3>
<p>Constructs a copy of <i>list</i>.</p>
<h3 class="fn"><a name="dtor.Q3StrList"></a>Q3StrList::~Q3StrList ()</h3>
<p>Destroys the list. All strings are removed.</p>
<h3 class="fn"><a name="operator-QList-ltQByteArray-gt"></a>Q3StrList::operator QList&lt;QByteArray&gt; () const</h3>
<p>Automatically converts a <a href="q3strlist.html">Q3StrList</a> into a <a href="qlist.html">QList</a>&lt;<a href="qbytearray.html">QByteArray</a>&gt;.</p>
<h3 class="fn"><a name="operator-eq"></a>Q3StrList &amp; Q3StrList::operator= ( const Q3StrList &amp; <i>list</i> )</h3>
<p>Assigns <i>list</i> to this list and returns a reference to this list.</p>
<h3 class="fn"><a name="operator-eq-2"></a>Q3StrList &amp; Q3StrList::operator= ( const <a href="qlist.html">QList</a>&lt;<a href="qbytearray.html">QByteArray</a>&gt; &amp; <i>list</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Assigns <i>list</i> to this list and returns a reference to this list.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
